﻿using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Runtime.InteropServices;

public enum JoinStatus
{
    Unknown = 0,
    UnJoined = 1,
    Workgroup = 2,
    Domain = 3
}

/// <summary>
/// Summary description for NetworkInfo
/// </summary>
static public class NetworkInfoNative
{
    [DllImport("netapi32.dll", CharSet = CharSet.Unicode, SetLastError = true)]
    static extern public int NetGetJoinInformation(string computerName, out IntPtr buffer, out JoinStatus status);

    [DllImport("netapi32.dll", SetLastError = true)]
    static extern public int NetApiBufferFree(IntPtr buffer);
}
